<template>
  <div>
    <el-table :data="list" style="width: 100%;padding-top: 15px;">
      <el-table-column label="状态" width="50" align="center">
        <template slot-scope="scope">
          <svg-icon icon-class="message" :class-name="scope.row.readed?'readed':'notread'" />
        </template>
      </el-table-column>
      <el-table-column label="案件名称" min-width="100">
        <template slot-scope="scope">
          {{ scope.row.title }}
        </template>
      </el-table-column>
      <el-table-column label="类型" width="100" align="center">
        <template slot-scope="scope">
          {{ scope.row.type }}
        </template>
      </el-table-column>
      <el-table-column label="日期" width="100" align="center">
        <template slot-scope="scope">
          {{ scope.row.date }}
        </template>
      </el-table-column>
    </el-table>
  </div>
</template>

<script>
import { transactionList } from '@/api/remote-search'

export default {
  filters: {
    statusFilter(status) {
      const statusMap = {
        success: 'success',
        pending: 'danger'
      }
      return statusMap[status]
    },
    orderNoFilter(str) {
      return str.substring(0, 30)
    }
  },
  data() {
    return {
      list: [
        { type: '督导', title: '某某某非法集资案1', date: '2021-06-01', readed: false },
        { type: '审核未通过', title: '某某某非法集资案2', date: '2021-05-29', readed: true },
        { type: '督导', title: '某某某非法集资案3', date: '2021-05-21', readed: true },
        { type: '审核未通过', title: '某某某非法集资案4', date: '2021-05-20', readed: true }
      ]
    }
  },
  created() {
    // this.fetchData()
  },
  methods: {
    fetchData() {
      transactionList().then(response => {
        this.list = response.data.items.slice(0, 8)
      })
    }
  }
}
</script>

<style scoped>
.readed {
  color:#ccc
}
.notread{
  color:#E69900
}
</style>
